<?
/**
*  操作历史
*  2013/8/20
*/
include("../webkit/include/simple_db.php");

include("session.php");
require("ajax_base.php");

$db = new SimpleDB();
$action = $_GET['action'];

if($action == "list") {
	$condition = "1=1";
	if(isset($_GET['time_range'])) {
		$arr = split("_", $_GET['time_range']);
		$condition .= " and (op_time between '".$arr[0]."' and '".$arr[1]."')";
	}
	$sql = "select a.id, a.op_user, a.order_no, a.op_desc, a.op_time, a.ip_address, b.id as order_id from jx_history a Left Join jx_order b On a.order_no=b.order_no where $condition order by a.id desc"; 
	echo to_grid_json($db, $sql, $dic_data, array("op_user"=>"blue_color_mapper","op_desc"=>"red_color_mapper", "order_id"=>"order_id_mapper"));
}



function order_id_mapper($v, $row) {
	return "<a href=\"javascript:show_order(".$row['order_id'].")\">查看工单</a>";
}
?>